package com.qww.factory.simplefactory;

public class SimpleFactory {

    public Pizza createPizza(OrderType orderType) {
        Pizza pizza = null;
        switch (orderType) {
            case CHEESE_PIZZA:
                pizza = new CheesePizza(OrderType.CHEESE_PIZZA);
                break;
            case GREEK_PIZZA:
                pizza = new GreekPizza(OrderType.GREEK_PIZZA);
                break;
            case PEPPER_PIZZA:
                pizza = new GreekPizza(OrderType.PEPPER_PIZZA);
                break;
            default:
                break;
        }
        return pizza;
    }

    public static Pizza createPizza2(OrderType orderType) {
        Pizza pizza = null;
        switch (orderType) {
            case CHEESE_PIZZA:
                pizza = new CheesePizza(OrderType.CHEESE_PIZZA);
                break;
            case GREEK_PIZZA:
                pizza = new GreekPizza(OrderType.GREEK_PIZZA);
                break;
            case PEPPER_PIZZA:
                pizza = new GreekPizza(OrderType.PEPPER_PIZZA);
                break;
            default:
                break;
        }
        return pizza;
    }
}
